#pragma once

#include "caProcOpener.h"
#include "caAnalyseClient.h"

class caCProcCtrl : public caIProcCtrl
{
	caIRMemAllocater* m_alloc;
	caIRMemReadWrite* m_rwctrl;
	IMessageSend* m_sender;
	caIProcDiplomat* m_attack;
public:
	caCProcCtrl(caIProcDiplomat* pa=NULL);
	virtual ~caCProcCtrl();

	BOOL Attach(DWORD pid);
	BOOL Detach();

	virtual caIRMemAllocater* GetRMemAllocater();
	virtual caIRMemReadWrite* GetRMemReadWrite();
	virtual IMessageSend*   GetMessageSend();


	virtual PVOID GetMemory(size_t size);
	virtual void FreeMemory(PVOID raddr);

	virtual DWORD Read(PVOID raddr,PVOID buffer,size_t size);
	virtual DWORD Write(PVOID raddr,PVOID buffer,size_t size);

	virtual LONGLONG SendMessage(IMessage* message);
};